package q2000_q2999;

/**
 * @Author: wzp
 * @CreateTime: 2024-09-21  10:11
 * @Description: 边积分最高的节点
 * @Version: 1.0
 */









public class q_2374 {
    public int edgeScore(int[] edges) {
        int arr[]=new int[edges.length];
        for (int i = 0; i < edges.length; i++) {
            arr[edges[i]]+=i;
        }
        int max=0;
        int index=0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]>max){
                index=i;
            }
        }
        return index;
    }
}
